<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--<%@ include file="/public/header/common.jspf" %>--%>
<!--头-->
<style>
    .switch-button {
        position: absolute;
        margin-left: 6px;
        margin-right: 6px;
        text-align: center;
    }
</style>

<div class="layui-header">
    <div class="switch-button">
        <a href="javascript:void(0);" id="GuideSwitchButton">
            <i class="layui-icon layui-icon-spread-left"
               style="font-weight: bold;font-size: 32px;color: cadetblue;">
            </i>
        </a>
    </div>
    <a href="javascript:;" class="layui-hide-xs">
        <a href="#" style="font-weight: bold;">
            <div class="layui-logo" style="margin-left: 36px;">长护险居家照护监管平台</div>
        </a>
    </a>
    <!-- 头部区域（可配合layui已有的水平导航） -->

    <ul class="layui-nav layui-layout-right">
        <li class="layui-nav-item">
            <a href="/maincontro/toPersonal">
                <img src="" class="layui-nav-img headImg">
                <canvas id="headImg" style="display:none"></canvas>
                <span id="userRealName">${sessionScope.currentUser.user_name}</span>
            </a>
        </li>
        <li class="layui-nav-item"><a href="/maincontro/login">退出</a></li>
    </ul>
</div>
<!--左侧导航-->
<div class="layui-side layui-bg-black">
<div class="layui-side-scroll">
    <ul id="MAIN-NAV" class='layui-nav layui-nav-tree' lay-filter='MAIN-NAV'>
        <li class='layui-nav-item' hash='1'>
            <a class='' href='javascript:;'>
                智能签到<span class='layui-nav-more'></span>
            </a>
            <dl class='layui-nav-child'>
                <dd><a href='/maincontro/toServiceDepart'>服务机构</a></dd>
                <dd><a href='/maincontro/toNurseStaff'>护理人员</a></dd>
                <dd><a href='/maincontro/toElderInfo'>居家老人</a></dd>
                <dd><a href='/maincontro/toArrangeInfo'>派工信息</a></dd>
                <dd><a href='/maincontro/toQiandao'>签到签退记录</a></dd>
                <dd><a href='/maincontro/toAlarm'>签到签退异常预警</a></dd>
                <dd><a href='/maincontro/toShebei'>设备档案</a></dd>
                <dd><a href='/maincontro/toShebeilog'>设备发放记录</a></dd>
                <dd><a href='/maincontro/toTempCheck'>飞行检查记录</a></dd>
            </dl>
        </li>
        <li class='layui-nav-item' hash='2'>
            <a class='' href='javascript:;'>
                区医保局监管后台 <span class='layui-nav-more'></span>
            </a>
            <dl class='layui-nav-child'>
                <li class='layui-nav-item' hash='21'>
                    <a class='' href='javascript:;'>
                        规则数据分析<span class='layui-nav-more'></span>
                    </a>
                    <dl class='layui-nav-child'>
                        <dd><a href='/maincontro/toStaticDataImport'>数据导入</a></dd>
                        <dd><a href='/maincontro/toDataAnalysis'>数据分析</a></dd>
                    </dl>
                </li>
                <li class='layui-nav-item' hash='22'>
                    <a class='' href='javascript:;'>
                        统计报表<span class='layui-nav-more'></span>
                    </a>
                    <dl class='layui-nav-child'>
                        <dd><a href='/report/'>结算数据 </a></dd>
                        <dd><a href='/maincontro/toJZFWTJ'>街镇服务统计</a></dd>
                        <li class='layui-nav-item' hash='221'>
                            <a class='' href='javascript:;'>
                                服务对象统计<span class='layui-nav-more'></span>
                            </a>
                            <dl class='layui-nav-child'>
                                <dd><a href='/maincontro/toHLYTJ'>护理员统计</a></dd>
                                <dd><a href='/maincontro/toBHLLRTJ'>被护理老人统计</a></dd>
                            </dl>
                        </li>
                    </dl>
                </li>

                <li class='layui-nav-item' hash='23'>
                    <a class='' href='javascript:;'>
                        系统管理<span class='layui-nav-more'></span>
                    </a>
                    <dl class='layui-nav-child'>
                        <dd><a href='/auth/toPermissionTree' style="display: block">权限编辑</a></dd>
                        <dd><a href='/maincontro/toRole' id="juesedangan" style="display: block">角色档案</a></dd>
                        <dd><a href='/maincontro/toUser' id="yonghudangan" style="display: block;">用户档案</a></dd>
                        <dd><a href='/maincontro/toSys' id="xitongrizhi" style="display: block">系统日志</a></dd>
                        <dd><a href='/maincontro/toPersonal'>个人信息</a></dd>
                    </dl>
                </li>

            </dl>
        </li>

        <li class='layui-nav-item' hash='3' id="dapingjiankong">
            <a class='' href='javascript:;'>
                大屏监控平台 <span class='layui-nav-more'></span>
            </a>
            <dl class='layui-nav-child'>
                <dd><a href='/maincontro/toDaping'>大屏展示</a></dd>
            </dl>
        </li>
    </ul>
</div>
</div>


<script type="text/javascript" src="${webPath}/js/utils.js"></script>
<script type="text/javascript" src="${webPath}/js/permission/head_test.js"></script>
<script>
    $(function () {
        var urealname = $("#userRealName").text();
        var uname = urealname;
        var name = uname.charAt(0);
        var fontSize = 150;
        var fontWeight = 'bold';

        var canvas = document.getElementById('headImg');
        var img1 = document.getElementById('headImg');
        canvas.width = 300;
        canvas.height = 300;
        var context = canvas.getContext('2d');
        context.fillStyle = '#949494';
        context.fillRect(0, 0, canvas.width, canvas.height);
        context.fillStyle = '#605CA8';
        context.font = fontWeight + ' ' + fontSize + 'px SimHei';
        context.textAlign = 'center';
        context.textBaseline = "middle";
        context.fillText(name, fontSize, fontSize);
        $('.headImg').attr('src', canvas.toDataURL("image/png"));
    });


    // $('.layui-side ul.layui-nav li.layui-nav-item dd>a').on('click', function (e) {
    //     let url = $(this).attr('href');
    //     ;
    //     //向当前url添加参数，没有历史记录
    //     url = window.location.origin + url;
    //     window.history.replaceState({
    //         path: url
    //     }, '', url);
    //     if(url){
    //         $('#body').load(url);
    //     }
    //
    //     return false;
    // })
</script>